;(function(doc){
    var zkBtn = document.querySelector(".header .btn");
    var oUl = document.querySelector(".header ul");

    function init(){
        setFontSize();
        bindEvent();
        console.log(navigator.userAgent)
    }

    function bindEvent(){
        window.addEventListener("resize",setFontSize,false);
        zkBtn.addEventListener("click",clickBtn,false);
    }

    function setFontSize(){
        var cWidth = document.documentElement.clientWidth;
        if(cWidth < 750){
            document.documentElement.style.fontSize = cWidth/75+'px';
        }else{
            var fontSize = document.documentElement.style.fontSize;
            if(fontSize !== '62.5%'){
                document.documentElement.style.fontSize = '62.5%';
            }
        }
        if(cWidth >= 769){
            oUl.style.display = "inline-block";
        }else{
            oUl.style.display = "none";
        }
    }
    function clickBtn(){
        var dis = oUl.style.display;
        if(dis === 'inline-block'){
            oUl.style.display = "none";
        }else{
            oUl.style.display = "inline-block";
        }
    }

    init()
})(document);

/*
不是手机设备跳转的路径
if(!(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNg|WebOS|Symbian|Windows Phone)/i))){
    window.location.href = "http://www.jsplusplus.com"
}
*/
